import PropTypes from 'prop-types';
import { Component } from 'react';

// ui组件
class UiDom extends Component {
    render() {
        const { val, onclickFunc } = this.props;
        return (
            <div>
                <span>我是数字：{val}</span>
                <button type="button" onClick={onclickFunc('小红')}>
                    点击效果
                </button>
            </div>
        );
    }
}
UiDom.propTypes = {
    val: PropTypes.number.isRequired,
    onclickFunc: PropTypes.func.isRequired
};

export default UiDom;
